<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>病人治疗项目系统</title>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <meta http-equiv="Access-Control-Allow-Origin" content="*"/>
    <link rel="stylesheet" type="text/css" href="/hospital/Public/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/hospital/Public/css/layui/layui.css" media="all"/>
    <link rel="stylesheet" href="/hospital/Public/css/style.css" media="all"/>
</head>
<body>
<div class="top">
    <div class="logo">
        <img src="/hospital/Public/images/logo.png"/>
        <span>治疗系统</span>
    </div>
    <ul class="oper" lay-filter="demo">
        <li class="layui-nav-item">
            <a href="<?php echo U('Home/home/home');?>" class="<?php if(ACTION_NAME == home): ?>on<?php endif; ?>">
                <i class="fa fa-home" style="font-size: 22px;"></i>
                <span>首页</span>
            </a>
        </li>
        <li class="layui-nav-item">
            <a href="<?php echo U('Home/home/member');?>" class="<?php if(ACTION_NAME == member|ACTION_NAME == memberDetails): ?>on<?php endif; ?>">
                <i class="fa fa-folder-open"></i> <span>人员管理</span>
            </a>
        </li>
        <li class="layui-nav-item">
            <a href="<?php echo U('Home/home/items');?>" class="<?php if(ACTION_NAME == items): ?>on<?php endif; ?>">
                <i class="fa fa-folder-open"></i>
                <span>项目管理</span>
            </a>
        </li>
    </ul>
</div>
<div class="contain" style="text-align: right;text-align: right; height: 30px; line-height: 40px; padding-right: 20px;">
    合计：<span id="allPrice" style="color:#f00;font-size: 16px;
    margin: 0 5px;">1900.00</span>元
</div>
<div class="contain layui-form">
    <table class="layui-table">
        <colgroup>
            <col width="150"/>
            <col/>
            <col width="200"/>
            <col width="200"/>
            <col width="150"/>
            <col width="150"/>
        </colgroup>
        <thead>
        <tr>
            <th class="text_c">姓名</th>
            <th class="text_c">治疗时间</th>
            <th class="text_c">治疗项目</th>
            <th class="text_c">治疗次数</th>
            <th class="text_c">单价</th>
            <th class="text_c">总价</th>
        </tr>
        </thead>
        <tbody>
        <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><tr>
                <td class="text_c"><?php echo ($data["name"]); ?></td>
                <td class="text_c"><?php echo ($data["time"]); ?></td>
                <td class="text_c"><?php echo ($data["xname"]); ?></td>
                <td class="text_c"><?php echo ($data["cishu"]); ?></td>
                <td class="text_c"><?php echo ($data["xprice"]); ?></td>
                <td class="text_c" _name="allPrice"><?php echo ($data['xprice'] * $data['cishu']); ?></td>
            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
        </tbody>
    </table>
</div>
<script src="/hospital/Public/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="/hospital/Public/js/jquery.js"></script>
<script>

    $(function(){
        var len = $('[_name="allPrice"]').length;
        var allPrice = 0;
        for(var i = 0; i < len; i++){
            allPrice += parseFloat($('[_name="allPrice"]').eq(i).html());
        }
      
        $('#allPrice').html(allPrice);
    })

</script>